package sql;

import java.sql.Connection;
import java.sql.DriverManager;

public class Connector {
	
	//connection a la main :
	//psql -h78.235.55.75 -p 3838 -d campus -Urecuperator -W
	public static String ip=  "127.0.0.1"; //"192.168.1.12";	//"192.168.0.15";
	public static String url = "jdbc:postgresql://"+ip+":5432/campus_lite"; //"jdbc:postgresql://"+ip+":5432/campus_lite";		
	public static String user = "recuperator";
	public static String password = "recuperator";

	public static Connection connecter(){

		Connection connection = null;

		try {
			Class.forName("org.postgresql.Driver");
			System.out.println("Driver O.K.");


			connection = DriverManager.getConnection(url, user, password);
			System.out.println("Connexion effective !");         

		} catch (Exception e) {
			e.printStackTrace();
		}   

		return connection;
	}
}
